home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / tclX6.4c / dist / tests / compat.test < prev    next >
Encoding:
Text File  |  1992-11-07  |  1.5 KB  |  51 lines

  1. #
  2. # compat.test
  3. #
  4. # Tests Tcl library compatiblity routines.
  5. #---------------------------------------------------------------------------
  6. # Copyright 1992 Karl Lehenbauer and Mark Diekhans.
  7. #
  8. # Permission to use, copy, modify, and distribute this software and its
  9. # documentation for any purpose and without fee is hereby granted, provided
  10. # that the above copyright notice appear in all copies.  Karl Lehenbauer and
  11. # Mark Diekhans make no representations about the suitability of this
  12. # software for any purpose.  It is provided "as is" without express or
  13. # implied warranty.
  14. #------------------------------------------------------------------------------
  15. # $Id: compat.test,v 2.0 1992/10/16 04:49:32 markd Rel $
  16. #------------------------------------------------------------------------------
  17. #
  18.  
  19. if {[info procs test] != "test"} then {source testlib.tcl}
  20. rename SAVED_UNKNOWN unknown
  21.  
  22. # execvp compatability tests.
  23.  
  24. set newPid [fork]
  25. if {$newPid == 0} {
  26.     execvp ../tcl "-qc" "sleep 1;exit 12"
  27.     error "Should never make it here"
  28. }
  29. test compatibility-1.1 {fork, execvp, wait and kill tests} {
  30.  
  31.     wait $newPid
  32. } "$newPid EXIT 12"
  33.  
  34. test compatibility-1.2 {fork, execvp, wait and kill tests} {
  35.     list [catch {kill} msg] $msg
  36. } {1 {wrong # args: kill [signal] processlist}}
  37.  
  38. set newPid [fork]
  39. if {$newPid == 0} {
  40.     execvp ../tcl "-qc" "catch {while {1} {sleep 1}}; exit 10"
  41.     error "Should never make it here"
  42. }
  43. sleep 1
  44.  
  45. test compatibility-1.3 {fork, execvp, wait and kill tests} {
  46.     kill $newPid
  47.     wait $newPid
  48. } "$newPid SIG SIGTERM"
  49.  
  50. rename unknown SAVED_UNKNOWN
  51.